TOPDIR=../..

include $(TOPDIR)/Makefile.common

SRCS     = $(wildcard *.cc) $(wildcard *.c)
OBJS     = $(SRCS:.cc=.o) $(CSRCS:.c=.o)
DEPENDS := $(SRCS:%.cc=.%.dep)

#CFLAGS += -I../reality -I$(TOPDIR)/include/utils
IDFLAGS += -I $(TOPDIR)/include/utils

# set the testing file to be the socket test

TARGET = libutils.a
TESTS  = socket_test configreader_test

all:: $(TARGET)

libutils.so: $(OBJS)

$(TARGET): $(OBJS)
	$(AR) -r $@ $^
	#$(CC) -Wl,-shared $^ -o $@
	cp $(TARGET) $(LIBDIR)/$(TARGET)

# the testing program compilation
test::
	@echo "Making tests..."
	@make $(TESTS)
	@for t in $(TESTS); do \
		echo "Running $$t..."; \
		./$$t; \
	done
